<?php



namespace App\Http\Requests\ApiV2;

use Illuminate\Support\Facades\Auth;

class FamilyRequest extends BaseRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'title' => 'required|max:120',

        ];
    }

    public function messages()
    {
        return [
            'name.required' => __('请输入家庭的名字'),
            'avatar.required' => __('请输入家庭的合照'),

        ];
    }

    public function filldata()
    {
        return [
            'user_id'=>Auth::id(),
            'name' =>(string) $this->input('name', ''),
            'avatar' =>(string) $this->input('avatar', ''),

        ];
    }
}
